package com.ellricky.teacher.ui.mycourse.pmeet

import com.ellricky.baselib.http.callback.ECallback
import com.ellricky.baselib.ui.base.BaseDetailActivity
import com.ellricky.teacher.API_PARENT_MEET_DETAIL
import com.ellricky.teacher.R
import com.ellricky.teacher.TcParentMeetDetailEntity
import kotlinx.android.synthetic.main.tc_activity_parent_meet_detail.*

class ParentMeetDetailActivity : BaseDetailActivity() {

    override fun getChildContentLayout(): Int {
        return R.layout.tc_activity_parent_meet_detail
    }

    override fun initUIView() {
        super.initUIView()
        mTvTitle.text = getString(R.string.tc_parent_meeting_detail)
        loadDetailData(id)

    }


    private fun loadDetailData(id: String) {
        mPresenter.loadDetail(API_PARENT_MEET_DETAIL, id, object : ECallback<TcParentMeetDetailEntity>(this) {
            override fun onSuccess(data: TcParentMeetDetailEntity?, msg: String) {

                data?.let {
                    tvFzPerson.value = it.name
                    tvMeetAddress.value = it.meetAddress
                    tvMeetDate.value = it.meetDate
                    tvMeetTime.value = it.meetTime
                    tvContent.text = it.meetInfo
                }
            }
        })
    }

}